<div class="row toolbar">
  <div class="col-md-6">
    <span class="toolbar-header">
      <%= @invoice_detail.new_record? ? "#{t(:new_invoice_detail)}" : "#{t(:edit)} #{t(:invoice_detail)}" %> 
    </span>
  </div>
  <div class="col-md-6 text-right">
    <ul class="toolbar-nav">
      <li><%= link_to simple_icon("user"), invoice_path(:id => params[:invoice_id]) %></li>
      <li><% link_to simple_icon("users"), invoice_details_path %></li>
    </ul>
  </div>
</div>

<%= form_for(@invoice_detail, url:
		if action_name == "new"
			invoice_invoice_details_path
		else
			invoice_invoice_detail_path
		end
	) do |f| %>
  <% if @invoice_detail.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@invoice_detail.errors.count, "error") %> prohibited this invoice_detail from being saved:</h2>

      <ul>
      <% @invoice_detail.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
  
  <%= render "stock_logging_form", form: f %>
  

  <div class="form-group">
    <%= f.label :invoice_item_type_id %><br>
    <%= f.collection_select(:invoice_item_type_id, InvoiceItemType.all, :id, :label, prompt: true) %>
    <%= link_to feather_icon('circle-plus'), new_invoice_invoice_item_type_path %>
  </div>
  <div class="form-group">
    <%= f.label :fee %><br>
    <%= f.text_field :fee %>
  </div>
  <div class="form-group">
    <%= f.label :discount %><br>
    <%= f.text_field :discount %>
  </div>
   <%= f.submit class: "btn btn-primary" %>
<% end %>
